package cn.texous.demo.dmqs.handler;

import cn.texous.demo.dmqs.executor.AsyncTaskExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * insert description here
 *
 * @author Showa.L
 * @since 2019/8/7 9:45
 */
@Slf4j
@Component
public class NsqMessageHandler implements MessageHandler {

    @Autowired
    private AsyncTaskExecutor asyncTaskExecutor;

    @Override
    public void handler(String message) {
        try {
            System.out.println("handler message");
            asyncTaskExecutor.sendRequsetMsg("topic", "key", message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
